<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="/main.js"></script>
    <!-- <script src="./dist/main.js"></script> -->

</head>

<body>
    <div id="app">
        <h1>{{title}}-hello-{{title}}</h1>
        <hr>
        <input type="text" v-model="title"/>
        <hr>
        <h1 v-text="msg"></h1>
        <hr>
        <input type="text" v-model="msg"/>
        <hr>
        <button onclick="update()">更新msg</button>
    </div>
</body>

<script>
    const vm = new Vue({
        el: '#app',
        data: {
            title: 'vue核心原理',
            msg: 'hello',
            user: {
                name: 'zs',
                dog: {
                    name: 'Iris'
                }
            }
        },
        methods: {
            getMsg() {
                console.log(this.msg);
            },
            getDogName() {
                console.log(this.user.dog.name);
            }
        }
    });

    function update() {
        vm.title = '你好';
    }
</script>

</html>